#include "../../common/etcd.h"
#include <gflags/gflags.h>
#include "../../common/logger.h"

DEFINE_bool(run_mode, true, "程序运行模式");
DEFINE_int32(log_level, 0, "发布模式下，日志输出等级");
DEFINE_string(log_file, "", "发布模式下，只能日志输出文件");

DEFINE_string(etcd_host, "http://127.0.0.1:10000", "服务注册中心地址");
DEFINE_string(base_service, "service", "服务监控根地址");
DEFINE_string(instance_name, "/friend/instance", "当前实列名称");
DEFINE_string(access_name, "127.0.0.1:8080", "当前实列名称");

int main(int argc, char *argv[])
{
    //初始化gflasg
    google::ParseCommandLineFlags(&argc, &argv, true);
    Init_logger(FLAGS_run_mode, FLAGS_log_file, FLAGS_log_level);
    Registry::ptr rclient = std::make_shared<Registry>(FLAGS_etcd_host);
    rclient->registry(FLAGS_base_service + FLAGS_instance_name, FLAGS_etcd_host);
    std::this_thread::sleep_for(std::chrono::seconds(600));
    return 0;
}